﻿IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'up_VendorInspVisitXMissionStructurePole_QuickSearch')
	DROP PROCEDURE up_VendorInspVisitXMissionStructurePole_QuickSearch
GO

CREATE PROCEDURE [dbo].[up_VendorInspVisitXMissionStructurePole_QuickSearch]
	 @UtilityFk int = 0
	,@Vendor_InspVisit_XMissionStructure_PoleID int = 0
AS

SET NOCOUNT ON	

SELECT 
	CAST(poles.Vendor_InspVisit_XMissionStructure_PoleID as varchar)
FROM 
	v_tb_Vendor_InspVisit_XmissionStructures_Poles poles
INNER JOIN tb_vendor_projects projects
	ON projects.Vendor_ProjectId = poles.Vendor_ProjectFK
	AND projects.UtilityFk = @UtilityFk
WHERE 
	poles.Vendor_InspVisit_XMissionStructure_PoleID = @Vendor_InspVisit_XMissionStructure_PoleID
